package fachlogik;

import java.awt.Color;
import java.awt.Component;

import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.ListCellRenderer;

import entities.Calendar;
import entities.Category;

public class CalendarCellRenderer extends JLabel implements ListCellRenderer {
	public Component getListCellRendererComponent(JList list, Object value,
			int index, boolean isSelected, boolean cellHasFocus) {
		if (value != null) {
			setOpaque(true);
			Calendar c = (Calendar) value;
			this.setText(c.getName());
		}
		if (isSelected)
			setBackground(Color.LIGHT_GRAY);
		else
			setBackground(Color.white);

		return this;
	}

}
